package com.github_Dididipapa.shortlink.admin.controller;



import com.github_Dididipapa.shortlink.admin.common.result.R;
import com.github_Dididipapa.shortlink.admin.feign.ProjectFeign;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: To be defined
 * @author: dididi_papa
 * @email: mitis1624087624@gmail.com
 * @date: 2025/09/17  21:59
 */
@RestController
@RequestMapping("/short-link/admin/v1")
@RequiredArgsConstructor
public class UrlResourceController {

    private final ProjectFeign urlResourceFeign;

    /**
     * @description: 获取URL的标题
     * @author: dididi_papa
     * @date: 2025/9/18 下午2:04
     * @param: [url]
     * @return: com.github_Dididipapa.shortlink.admin.common.result.R<java.lang.String>
     **/
    @GetMapping("/title")
    public R<String> getUrlTitle(@RequestParam("url") String url) {
        return urlResourceFeign.getUrlTitle(url);
    }
}
